var a = getApp(), e = require("../../utils/util.js");

Page({
    data: {
        list: a.globalData.sxdata,
        mhei: a.globalData.sheight,
        infodata: "",
        male: 1,
        female: 1,
        malename: "鼠",
        femalename: "鼠",
        userInfo: "",
        iscollect: !1,
        sharelayer: !1,
        modalHidden: !1,
        showModalStatus: !1,
        mengshow: !1,
        bottom: "-100%",
        openSettingBtnHidden: !0,
        hide_qcode: 1,
        id: ""
    },
    onLoad: function(t) {
        var o = this, n = this, s = e.GetCxId(t.id, 4);
        console.log(t.id, s), n.setData({
            male: s[0] - 1,
            female: s[1] - 1
        }), console.log(n.data);
        var i = decodeURIComponent(this.options.scene);
        if (i) {
            var l = a._get(i, "id");
            l && (s = l);
            var r = s[0] - 1, d = s[1] - 1;
            n.setData({
                id: s,
                male: r,
                female: d
            });
        }
        e.getPairData(n, "sx", function() {
            parseInt(r), parseInt(d), encodeURIComponent("id=" + s), console.log("数据", n.data.infodata);
        }), a.globalData.userInfo ? this.setData({
            userInfo: a.globalData.userInfo,
            hasUserInfo: !0
        }) : this.data.canIUse ? a.userInfoReadyCallback = function(a) {
            o.setData({
                userInfo: a.userInfo,
                hasUserInfo: !0
            });
        } : wx.getUserInfo({
            success: function(e) {
                a.globalData.userInfo = e.userInfo, o.setData({
                    userInfo: e.userInfo,
                    hasUserInfo: !0
                });
            }
        }), n.data.infodata, n.data.userInfo && n.data.userInfo.avatarUrl;
    },
    share: function(a) {
        var e = this;
        e.hideModal(), e.setData({
            hide_qcode: 0
        });
    },
    showModal: function(a) {
        var t = this;
        e.showModal(t);
    },
    hideModal: function(a) {
        var t = this;
        e.hideModal(t);
    },
    getUserInfo: function(e) {
        console.log(e), a.globalData.userInfo = e.detail.userInfo, this.setData({
            userInfo: e.detail.userInfo,
            hasUserInfo: !0
        });
    },
    closeQcode: function() {
        this.setData({
            hide_qcode: 1
        });
    },
    test: function() {
        var a = encodeURIComponent("id=4_7");
        wx.navigateTo({
            url: "/pages/sxpair_info/sxpair_info?scene=" + a
        });
    },
    handleSetting: function(a) {
        var e = this;
        a.detail.authSetting["scope.writePhotosAlbum"] && (e.setData({
            openSettingBtnHidden: !0
        }), drawImg.save_file(e));
    },
    goback: function(a) {
        wx.navigateBack({
            delta: 1
        });
    },
    navigateToPair: function(a) {
        wx.navigateTo({
            url: "/pages/pair_sx/index"
        });
    },
    onShareAppMessage: function(a) {
        "button" === a.from && console.log(a.target);
        var t = e.formatCxLink(4, [ this.data.male + 1, this.data.female + 1 ]);
        return console.log(t), {
            title: "生肖配对详情",
            path: "/pages/pair_sx/sxpair_info?id=" + t
        };
    }
});